home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IRIX Patches 1995 September
/
SGI IRIX Patches 1995 Sep.iso
/
5.3_patches
/
patchSG0000466
/
patchSG0000466.idb
/
etc
/
init.d
/
disk_patch.z
/
disk_patch
Wrap
Text File
|
1995-09-07
|
1KB
|
52 lines
#! /sbin/sh
#Tag 0x00000f00
is_deskside ()
{
maxslot=0
hinv -c iobd | grep Ebus | sed "s/://g" | ( \
while read io brd ebus slot slotnum io4 rev revnum; do
if [ $slotnum -gt $maxslot ]; then
maxslot=$slotnum;
fi;
done;
if [ $maxslot -gt 0 -a $maxslot -lt 11 ]; then
echo 1
else
echo 0
fi)
}
case $1 in
'start')
# check to see if any drives need firmware downloaded, on powerup
# This is to handle any drives moved from another system, etc.,
# This just warns if any drives should be upgraded.
/sbin/diskpatch -W
;;
'stop')
# if we are rebooting, then don't spin down any of the drives.
# otherwise spin down all of the drives that benefit from this
set `who -r`
if [ $7 != "6" ]
then
if hinv -c iobd | grep IO4 > /dev/null
then # [Power] Challenge/Onyx DM/L/XL (EVEREST Machines)
if [ `is_deskside` -eq 1 ]; then
spinagain=-S11
else
spinagain=-S5
fi
elif [ "`hinv -c disk | egrep 'Disk.*controller *[1-4]' | wc -l`" -gt 3 ]
then
# challenge S, jag or indigo2/challenge M w/external drives
spinagain=-S4
fi
/sbin/diskpatch -H 20 $spinagain
fi
;;
*)
echo "usage: $0 {start|stop}"
;;
esac